package com.autonavi.yunda.yunji.core.vo;

import com.autonavi.yunda.yunji.core.engine.context.EngineContext;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

/**
 * @author cizhong.wcs
 * @date 2022/6/15 10:22
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DebugResult {
    public String executeStatus;
    /**
     * response返回结果
     */

    public Object response;
    public Map<String, String> responseHeaders;
    /**
     * 返回结果中的数据(data)
     */
    @JsonIgnore
    public Object output;
    public EngineContext context;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public String errorMessage;

    public DebugResult(String executeStatus, Object response, Object output, EngineContext context, String errorMessage, Map<String, String> responseHeaders) {
        this.executeStatus = executeStatus;
        this.response = response;
        this.output = output;
        this.context = context;
        this.errorMessage = errorMessage;
        this.responseHeaders = responseHeaders;
    }

    /**
     * 跳过返回debugResult，再自定义输出流时使用
     */
    @JsonIgnore
    public boolean skipReturnDebugResult = false;
}
